// tips: 如果是单独实例允许需要注释这一行
import "./set-public-path"; 
import Vue from 'vue'
import App from './App.vue'
import {initRouter} from './router'
import './theme/index.less'
import Antd from 'ant-design-vue'
import Viser from 'viser-vue'
import '@/mock'
import store from './store'
import 'animate.css/source/animate.css'
import Plugins from '@/plugins'
import {initI18n} from '@/utils/i18n'
import bootstrap2 from '@/bootstrap'
import 'moment/locale/zh-cn'
import singleSpaVue from "single-spa-vue";

const router = initRouter(store.state.setting.asyncRoutes)
const i18n = initI18n('CN', 'US')

Vue.use(Antd)
Vue.config.productionTip = false
Vue.use(Viser)
Vue.use(Plugins)

bootstrap2({router, store, i18n, message: Vue.prototype.$message})

// tips: 如果是单独实例允许需要还原以下内容
// new Vue({
//   render(h) {
//     return h(App, { props: { githubLink: this.githubLink } });
//   },
//   router,
//   store,
//   i18n,
// }).$mount("#app")


// tips: 如果是单独实例允许需要注释以下内容
const vueLifecycles = singleSpaVue({
  Vue,
  appOptions: {
    render(h) {
      return h(App, { props: { githubLink: this.githubLink } });
    },
    router,
    store,
    i18n,
  },
});

export const bootstrap = vueLifecycles.bootstrap;
export const mount = vueLifecycles.mount;
export const unmount = vueLifecycles.unmount;
